function setCookie(name,value,exdays)
{
  var date = new Date();
  date.setTime(date.getTime() + (exdays*24*60*60*1000));
  var expires = "expires=" + date.toGMTString();
  document.cookie = name + "=" + value + "; " + expires;
}